package arg

import (
	"fmt"
	"github.com/gurkankaymak/hocon"
	"db2s/go-log/log"
)

func logInit(hocon *hocon.Config) (err error) {
	var logS logDefVal
	var logPath []string
	if logS, err = logParameterLegitimacy(hocon); err != nil {
		return
	}
	for _, v := range []string{
		logS.File, logS.Schedule, logS.Monitor, logS.SendMsg, logS.Error,
	} {
		logPath = append(logPath, fmt.Sprintf("%v/%v",logS.FilePath,v))
	}
	return log.CreateLogger(logPath, logS.Level)
}
